home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-157.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  43.0 KB  |  1,188 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Mon, 03 Aug 92       Volume 1 : Issue 157
  2.  
  3. Today's Topics:
  4.  
  5.     *ugh* More menu probs
  6.     MBDF Protocol
  7.     68030 Instruction List wanted
  8.     How to print a postscript file?
  9.     Think C / ANSI Gotcha
  10.     Internationalization of a dialog box
  11.     Magazine Subs Info - Please help
  12.     Converting a Unix Sockets-based program to MacTCP
  13.     How do I dequeue MacTCP calls?
  14.     Does the PolySmooth PicComment work?
  15.     Why is gray drawing slower than color?
  16.  
  17.  
  18.  
  19. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  20.  
  21. The digest is a collection of article threads from the internet newsgroup
  22. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  23. regularly and want an archive of the discussions.  If you don't know what a
  24. newsgroup is, you probably don't have access to it.  Ask your systems
  25. administrator(s) for details.  (This means you can't post questions to the
  26. digest.)
  27.  
  28. Each issue of the digest contains one or more sets of articles (called
  29. threads), with each set corresponding to a 'discussion' of a particular
  30. subject.  The articles are not edited; all articles included in this digest
  31. are in their original posted form (as received by our news server at
  32. cs.uoregon.edu).  Article threads are not added to the digest until the last
  33. article added to the thread is at least one month old (this is to ensure that
  34. the thread is dead before adding it to the digest).  Article threads that
  35. consist of only one message are generally not included in the digest.
  36.  
  37. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  38. [128.223.8.8] in the directory /pub/mac/csmp-digest.  The most recent issues
  39. are available from sumex-aim.stanford.edu [36.44.0.6] in the directory
  40. /info-mac/digest/csmp.  If you don't have ftp capability, the sumex archive
  41. has a mail server; send a message with the text '$MACarch help' (no quotes)
  42. to LISTSERV@ricevm1.rice.edu for more information.
  43.  
  44. The digest is also available via email.  Just send a note saying that you
  45. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  46. automatically receive each new issue as it is created.  Sorry, back issues
  47. are not available through the mailing list.
  48.  
  49. Send administrative mail to mkelly@cs.uoregon.edu.
  50.  
  51.  
  52. -------------------------------------------------------
  53.  
  54. From: mmigdol@ccwf.cc.utexas.edu (michael a migdol)
  55. Subject: *ugh* More menu probs
  56. Date: 24 Jun 92 21:24:44 GMT
  57. Organization: The University of Texas at Austin, Austin TX
  58.  
  59. Ah, well, another day, another bug, another plea to csmp. :)
  60.  
  61. The program I'm working on uses a single menu-update routine. Here's the
  62. meat of it:
  63.  
  64. void MakeMenu() {
  65.     Handle       barHndl;
  66.     MenuHandle menHndl;
  67.     
  68.     /* Reset menus */
  69.     barHndl = GetNewMBar(MyMBarID);
  70.     SetMenuBar(barHndl);
  71.     
  72.     /* Some stuff deleted here */
  73.  
  74.     menHndl = GetMHandle(AppleMenu);
  75.     AddResMenu(menHndl,'DRVR');
  76.     DrawMenuBar();
  77. }
  78.  
  79. The stuff in the deleted section works fine, but when this routine is called
  80. for the second time, GetMHandle(AppleMenu) returns a zero, leading to a 
  81. generally chaotic state of the universe in which the apple menu has several
  82. copies of the DA list floating around in it. :)
  83.  
  84.  
  85. Any suggestions would be greatly appreciated. I'll post any interesting replies
  86. back to the group.
  87. Thanks in advance!
  88. - -Michael
  89.  
  90. +++++++++++++++++++++++++++
  91.  
  92. From: mmigdol@ccwf.cc.utexas.edu (michael a migdol)
  93. Date: 24 Jun 92 22:18:34 GMT
  94. Organization: The University of Texas at Austin, Austin TX
  95.  
  96. Ok, everyone, repeat after me....
  97.     "Think Reference is not a substitute for Inside Mac"
  98.     "Think Reference is not a substitute for Inside Mac"
  99.     "Think Reference is not a substitute for Inside Mac"
  100.     
  101. Thanks to Stepan Riha for pointing out that it's a no-no to call GetNewMBar
  102. more than once. (A fact that's mentioned in IM I, but not TR) :) 
  103.  
  104. Is it Friday yet?
  105. - -Michael
  106.  
  107.  
  108. +++++++++++++++++++++++++++
  109.  
  110. From: Stephan Bublava <krapf@email.tuwien.ac.at>
  111. Organization: Fachschaft Informatik, TU Wien
  112. Date: Thu, 25 Jun 1992 12:15:54 GMT
  113.  
  114. >The program I'm working on uses a single menu-update routine. Here's the
  115. >meat of it:
  116. >
  117. >void MakeMenu() {
  118. >    Handle       barHndl;
  119. >    MenuHandle menHndl;
  120. >    
  121. >    /* Reset menus */
  122. >    barHndl = GetNewMBar(MyMBarID);
  123. >    SetMenuBar(barHndl);
  124. >    
  125. >    /* Some stuff deleted here */
  126. >
  127. >    menHndl = GetMHandle(AppleMenu);
  128. >    AddResMenu(menHndl,'DRVR');
  129. >    DrawMenuBar();
  130. >}
  131.  
  132. I suppose by "menu-update routine" you mean a routine that disables and
  133. enables menu items. In such a routine there is no need to call GetNewMbar.
  134. In fact I call GetNewMBar only once in my programs (but i use only one
  135. menu bar.)
  136.  
  137. The listing looks like a routine that initializes the menus at programm
  138. startup. By the way you should also call DisposeHandle (barHndl) at the
  139. end of your routine because SetMenuBar makes a copy of the handle you
  140. pass it.
  141.  
  142. If you really want do disable and enable menu items do someting like the
  143. following:
  144.  
  145.     menHandle := GetMHandle (menu_id);
  146.     DisableItem (menHandle, item_number);
  147.     ...
  148.     
  149. If this is not what you want to do, please specify the purpose of your
  150. routine in more detail.
  151.  
  152. Hope this helps,
  153.  
  154. Stephan Bublava
  155. krapf@email
  156.  
  157. +++++++++++++++++++++++++++
  158.  
  159. From: dan@umiami.ir.miami.edu
  160. Date: 29 Jun 92 15:10:05 GMT
  161. Organization: Univ of Miami IR
  162.  
  163. In article <74575@ut-emx.uucp>, mmigdol@ccwf.cc.utexas.edu (michael a migdol) writes:
  164.  
  165. > Thanks to Stepan Riha for pointing out that it's a no-no to call GetNewMBar
  166. > more than once. (A fact that's mentioned in IM I, but not TR) :) 
  167.  
  168. As a side note: Remember menu ID's and MENU resource ID's don't necessarily 
  169. match. If you create a MENU in ResEdit, they will match initially if there are 
  170. no resource conflicts. But if you start changing menus around, they can end up 
  171. different. This can cause all sorts of problems that would be hard to diagnose 
  172. if you didn't know about the ID problem. Just thought I'd point that out :)
  173.  
  174. Dan
  175. /-------------------------------------------------------------------------\
  176. |   Dan Weisman -  University of Miami - Florida   |  ||   ||   ||   ||   |
  177. |--------------------------------------------------|  ||   ||   ||\ /||   |
  178. |   INTERNET  -----> dweisman@umiami.IR.Miami.edu  |  ||   ||   || | ||   |
  179. |     BITNET  -----> dweisman@umiami               |  |||||||   || | ||   |
  180. |-------------------------------------------------------------------------|
  181. |  "Think for yourself and feel the walls become sand beneath your feet"  |
  182. |    -Queensryche, "Anybody Listening"                  |
  183. \_________________________________________________________________________/
  184.  
  185. +++++++++++++++++++++++++++
  186.  
  187. From: lari@bach.cs.unc.edu (Humayun Lari)
  188. Date: 29 Jun 92 17:04:53 GMT
  189. Organization: University of North Carolina, Chapel Hill
  190.  
  191. In article <1992Jun29.111006.13623@umiami.ir.miami.edu> dan@umiami.ir.miami.edu writes:
  192. >As a side note: Remember menu ID's and MENU resource ID's don't necessarily 
  193. >match. If you create a MENU in ResEdit, they will match initially if there are 
  194. >no resource conflicts. But if you start changing menus around, they can end up 
  195. >different. This can cause all sorts of problems that would be hard to diagnose 
  196.  
  197. A good way to prevent this from happening (at least in ResEdit 2.1.1) is to
  198. remember to always open the menu before choosing Get Resource Info to set
  199. the resource ID. ResEdit will warn you that the internal menu ID is different
  200. from the new resource ID and ask if you want to change that too; just hit 
  201. Return and it'll do it for you. Nicely done, but IMHO you shouldn't have to 
  202. open the menu first...
  203.  
  204. >...Just thought I'd point that out :)
  205.  
  206. Just thought I'd point this out. :-)
  207.  
  208.  
  209. Humayun Lari
  210. (lari@cs.unc.edu)
  211.  
  212. ---------------------------
  213.  
  214. From: leban@graviton.lcs.mit.edu (Bruce Leban)
  215. Subject: MBDF Protocol
  216. Date: 25 Jun 92 16:47:27 GMT
  217. Organization: lcs.mit.edu
  218.  
  219. I have a question about the protocol for calling an MBDF.  The GetRect
  220. message does not appear to work as documented.
  221.  
  222. The MBDF itself is documented as returning a longint, but the GetRect
  223. message is documented as returning a rect.  Clearly a rect cannot fit in a
  224. longint.  (The MBDF is documented at the end of the Menu Manager chapter in
  225. volume V; I think the respective page numbers are 251 and 254, but the book
  226. is at home.)  I've examined the value actually returned by the MBDF and it
  227. appears to be neither a pointer nor a handle to a rect.  I've tried passing
  228. a pointer to a rect as an extra first or last parameter and neither works.
  229. (Incidentally, I'm calling this from Think C.)  Does anyone know how this is
  230. really supposed to work?
  231.  
  232. I have looked through all 6 volumes of Inside Mac and the most recent
  233. version of the Tech Notes stack downloaded from ftp.apple.com and I cannot
  234. find any explanation.
  235.  
  236. Thanks for any help.
  237.  
  238.     --- Bruce
  239.     Leban@graviton.lcs.mit.edu  @somerville.mass.usa.earth
  240.  
  241. +++++++++++++++++++++++++++
  242.  
  243. From: keith@taligent.com (Keith Rollin)
  244. Date: 26 Jun 92 18:37:18 GMT
  245. Organization: Taligent
  246.  
  247. In article <1992Jun25.164727.17171@mintaka.lcs.mit.edu>,
  248. leban@graviton.lcs.mit.edu (Bruce Leban) writes:
  249. > I have a question about the protocol for calling an MBDF.  The GetRect
  250. > message does not appear to work as documented.
  251. > The MBDF itself is documented as returning a longint, but the GetRect
  252. > message is documented as returning a rect.  Clearly a rect cannot fit in a
  253. > longint.  (The MBDF is documented at the end of the Menu Manager chapter in
  254. > volume V; I think the respective page numbers are 251 and 254, but the book
  255. > is at home.)  I've examined the value actually returned by the MBDF and it
  256. > appears to be neither a pointer nor a handle to a rect.  I've tried passing
  257. > a pointer to a rect as an extra first or last parameter and neither works.
  258. > (Incidentally, I'm calling this from Think C.)  Does anyone know how this is
  259. > really supposed to work?
  260. > I have looked through all 6 volumes of Inside Mac and the most recent
  261. > version of the Tech Notes stack downloaded from ftp.apple.com and I cannot
  262. > find any explanation.
  263.  
  264. The MBDF is returning a pointer to a rect. Often, this is a pointer to a
  265. low-memory global. Other times, it's to a rect in a private MBDF data structure.
  266.  
  267. BTW: I'm not sure if MBDF writing is supported. There are many messages that the
  268. Menu Manager sends to the MBDF that aren't documented anywhere. I only know this
  269. because I've been disassembling the 7.0 MBDF so that I, too, can write my own  
  270. :-).
  271.  
  272. Perhaps someone with access to the new Inside Mac can tell us what the
  273. documentation for the 90's says.
  274.  
  275. - --
  276. Keith Rollin
  277. Phantom Programmer
  278. Taligent, Inc.
  279.  
  280.  
  281. ---------------------------
  282.  
  283. From: kevin@crash.cts.com (Kevin Hill)
  284. Subject: 68030 Instruction List wanted
  285. Date: 25 Jun 92 16:14:51 GMT
  286. Organization: Crash TimeSharing, El Cajon, CA
  287.  
  288.  
  289.   I am curious, does someone out in netland have file that has all
  290. the opcodes for the 68000 family?  can you send it to me?  Preferably,
  291. it will have info on each instruction (i.e. what regs are used in the 
  292. opcode)
  293.   If no one has heard of such a thing, perhaps mention a good book that 
  294. goes over it all...
  295.   -Kevin
  296.  
  297. +++++++++++++++++++++++++++
  298.  
  299. From: niko@iastate.edu (Nikolaus E Schuessler)
  300. Organization: Iowa State University, Ames, IA
  301. Date: Fri, 26 Jun 1992 02:16:46 GMT
  302.  
  303. In article <1992Jun25.161451.20442@crash.cts.com> kevin@crash.cts.com (Kevin Hill) writes:
  304. >  I am curious, does someone out in netland have file that has all
  305. >the opcodes for the 68000 family?  can you send it to me?  Preferably,
  306. >it will have info on each instruction (i.e. what regs are used in the 
  307. >opcode)
  308. >  If no one has heard of such a thing, perhaps mention a good book that 
  309. >goes over it all...
  310. >  -Kevin
  311. >
  312.  
  313.  Even better than a file, you can have the 'official' Motorola documentation
  314. by calling / writing them... It will cost you almost nothing -- If you
  315. are involved with a educational institution of some sort and you ask nice,
  316. they may even send it to you for free...
  317.  
  318. You want the "Enhanced 32-Bit Microprocessor User's Manual" -- what they want
  319. to know is the following part number: MC68030UM/AD (for the 68030)
  320.  
  321. I don't know if the ISBN will help or not but anyway here it is:
  322. ISBN 0-13-566423-3 (again for the 68030)
  323.  
  324. There is also the 68000 Programmers Reference Manual which also seems
  325. to include FPU instructions (M68000PM/AD).
  326.  
  327. Hope this helps!
  328. - -- 
  329. Niko Schuessler                                             niko@iastate.edu
  330. Project Vincent Systems Manager
  331. Iowa State University                                       voice: 294-1672
  332. Ames IA 50010
  333.  
  334. +++++++++++++++++++++++++++
  335.  
  336. From: ksand@apple.com (Kent Sandvik (Hacker))
  337. Date: 1 Jul 92 01:40:07 GMT
  338. Organization: Apple
  339.  
  340. In article <1992Jun25.161451.20442@crash.cts.com>, kevin@crash.cts.com
  341. (Kevin Hill) wrote:
  342. >   I am curious, does someone out in netland have file that has all
  343. > the opcodes for the 68000 family?  can you send it to me?  Preferably,
  344. > it will have info on each instruction (i.e. what regs are used in the 
  345. > opcode)
  346. >   If no one has heard of such a thing, perhaps mention a good book that 
  347. > goes over it all...
  348. >   -Kevin
  349.  
  350. 68030 Assembly Language Reference, by Williams, has MPW 68000 asm code in
  351. the book. Or then the Motorola specs.
  352.  
  353. Kent Sandvik/DTS
  354.  
  355. ---------------------------
  356.  
  357. From: dank@calvin.usc.edu (Dan King)
  358. Subject: How to print a postscript file?
  359. Date: 25 Jun 92 03:58:21 GMT
  360. Organization: University of Southern California, Los Angeles, CA
  361.  
  362.  
  363.  
  364. Howdy, y'all.  A quick question: What's the easiest way to print a
  365. postscript file from within a program?
  366.  
  367. The situation:
  368. I've got a program that is reading a MacTCP stream (which is just a
  369. postscript file that a Unix box is vomiting at me).  I want to redirect
  370. this stream to a LaserWriter.  (Yes, it's a poor man's print spooler,
  371. but there are a few other added complexities that make me unable to use
  372. any commercial product I've seen.)
  373.  
  374. Is there a quick and easy solution?
  375.  
  376. Thanks,
  377. dank
  378.  
  379. +++++++++++++++++++++++++++
  380.  
  381. From: de19@umail.umd.edu (Dana S Emery)
  382. Date: 26 Jun 92 03:46:41 GMT
  383. Organization: Personal
  384.  
  385. In article <l4k29tINN1kh@calvin.usc.edu>, dank@calvin.usc.edu (Dan King) writes:
  386. > I've got a program that is reading a MacTCP stream (which is just a
  387. > postscript file that a Unix box is vomiting at me).  I want to redirect
  388. > this stream to a LaserWriter.
  389. >...
  390. > Is there a quick and easy solution?
  391.  
  392. Not unless Adobe has upgraded the SendPS utility to accept Apple events.
  393.  
  394. Baring that:
  395.  
  396. You will have to parse the stuff (hopefully it will follow the adobe 
  397. structured comment conventions).  You can emit PS either of 2 ways.
  398.  
  399. 1 - via pic comments.
  400. 2 - via drawtext/drawchar/drawstring, with font set to 'Postscript_Escape' 
  401. (special font which your code should supply, see LW driver 'STR ' -8188 for 
  402. actual name, I think Sumex has an FTP'able example.)
  403.  
  404. The LW driver will ignore the content of the PS, and so it falls on your code
  405. to ensure that fonts not inline with the PS stream are supplied.
  406.  
  407. Your parsing will have 2 objectives. 
  408.  
  409. 1 - establishing font requirements.
  410. 2 - isolateing pages for emision (remember, the LW driver reserves the
  411. pagination and header emission for itself.)
  412.  
  413. You may have to buffer to disk in order to deal with the 'AtEnd' convention.
  414.  
  415. Good luck, Dana S Emery (de19@umail.umd.edu)
  416.  
  417. ---------------------------
  418.  
  419. From: pgc@po.CWRU.Edu (Peter G. Cramer)
  420. Subject: Think C / ANSI Gotcha
  421. Date: 25 Jun 92 18:19:49 GMT
  422. Organization: Case Western Reserve University, Cleveland, OH (USA)
  423.  
  424.  
  425. I have run across a gotcha in Think C related to the use
  426. of ANSI standard routines.  The bottom line is that if
  427. you are using ANSI functions, make sure "native floating
  428. point format" under "Compiler Settings" is turned OFF!
  429. (at least in version 5.0.)
  430.  
  431. If you want to try it for yourself, here is a program 
  432. you can use:
  433. - --------------------
  434. #include <stdio.h>
  435.  
  436. main()
  437. {
  438.     char        *s = "3.14159";
  439.     float        myVar;
  440.  
  441.     sscanf( s, "%f", &myVar ); 
  442.     printf( "myVar = %f\n", myVar );
  443. }
  444. - -------------------
  445.  
  446. I guess it's not so surprising that this is the case.  If it isn't
  447. mentioned in the manuals (I haven't seen it), it should be.
  448.  
  449. Best,
  450. - -- 
  451. Peter G. Cramer, Physics Department, CWRU
  452. University Circle   Cleveland, Ohio 44106
  453. (216) 368-3656            pgc@po.cwru.edu  
  454.  
  455. +++++++++++++++++++++++++++
  456.  
  457. From: scott@mcl.ucsb.edu (Scott Bronson)
  458. Date: 29 Jun 92 19:55:35 GMT
  459.  
  460. In <1992Jun25.181949.28946@usenet.ins.cwru.edu> pgc@po.CWRU.Edu (Peter G. Cramer) writes:
  461.  
  462.  
  463. >The bottom line is that if
  464. >you are using ANSI functions, make sure "native floating
  465. >point format" under "Compiler Settings" is turned OFF!
  466. >If it isn't mentioned in the manuals (I haven't seen it), it should be.
  467.  
  468.  
  469. If this isn't in the FAQ, it should be.
  470.  
  471. Though the THINK manual doesn't go out of its way to document this, it
  472. is certainly in there.  If you browse the index for five or ten minutes
  473. you will eventually find out where this is described.  Sorry I don't have
  474. the manual here at school, or I could tell you right now.
  475.  
  476. If you change the "mc -68881/882" or "Use Native Floating Point" options
  477. from their default values, you must re-compile the ANSI libraries or their
  478. object code will not reflect the format you are using for your source
  479. (whether or not you are using SANE's 80-bit extendeds or Motorola FPU's
  480. 96-bit ones).
  481.  
  482.     - Scott
  483.  
  484. ---------------------------
  485.  
  486. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  487. Subject: Internationalization of a dialog box
  488. Date: 25 Jun 92 18:57:54 GMT
  489. Organization: University of Illinois at Urbana
  490.  
  491. I have a piece of code which I am hoping to make as
  492. "internationalizable" as possible. Most of the stuff in the Script
  493. Manager I am having no problems with, but I have run into two problems
  494. concerning text in a Modal dialog box for which I cannot find the
  495. answer. This code, by the way, must run under System 6 as well as
  496. System 7.
  497.  
  498. 1. I have a few TE boxes in this dialog. One of them can take any sort
  499. of printable text and the others can take only numerals (i.e. things I
  500. can convert to numbers in the program). I want to give some feedback
  501. to the user from within my dialog filter by flagging keystrokes that
  502. are no good and beeping. This would mean not allowing non-printables
  503. in the first box and not allowing non-digits in the others. The
  504. problem is that I could get double-byte characters, i.e. two separate
  505. events. What is the best way to handle this? Can I filter the way I
  506. want to, or do I basically have to let the user enter what they want
  507. and go back and complain once they hit "OK"?
  508.  
  509. 2. I am going to draw some text in a small box in my dialog. The box
  510. is just a userItem in my DITL which I will do a FrameRect; it will be
  511. wide enough for the longest possible string. What I am having a
  512. problem with is how to actually draw the text. If I am in a
  513. left-to-write script, I simply move to the left side of the box and
  514. call DrawText. But if I am in a right-to-left script, where do I start
  515. my DrawText? Should I start at the right side of the box, or
  516. MeasureText pixels from the right side? Is there an cleaner way to do
  517. this?
  518.  
  519. Sample code would be appreciated, but ideas are really what I am
  520. looking for.
  521.  
  522. pr
  523. - --
  524. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  525. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  526. System manager - Cognitive Science Group, Beckman Institute, UIUC
  527. Internet: resnick@cogsci.uiuc.edu
  528.  
  529. +++++++++++++++++++++++++++
  530.  
  531. From: leonardr@ccs.itd.umich.edu
  532. Organization: Campus Computing Sites, University of Michigan-Ann Arbor
  533. Date: Fri, 26 Jun 92 02:34:27 GMT
  534.  
  535. In article <BqF0oL.L12@news.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  536. >I have a piece of code which I am hoping to make as
  537. >"internationalizable" as possible. Most of the stuff in the Script
  538. >Manager I am having no problems with, but I have run into two problems
  539. >concerning text in a Modal dialog box for which I cannot find the
  540. >answer. This code, by the way, must run under System 6 as well as
  541. >System 7.
  542. >
  543.     No problem....
  544.  
  545. >1. I have a few TE boxes in this dialog. One of them can take any sort
  546. >of printable text and the others can take only numerals (i.e. things I
  547. >can convert to numbers in the program). I want to give some feedback
  548. >to the user from within my dialog filter by flagging keystrokes that
  549. >are no good and beeping. This would mean not allowing non-printables
  550. >in the first box and not allowing non-digits in the others. The
  551. >problem is that I could get double-byte characters, i.e. two separate
  552. >events. What is the best way to handle this? Can I filter the way I
  553. >want to, or do I basically have to let the user enter what they want
  554. >and go back and complain once they hit "OK"?
  555. >
  556.     Take a look at the CharByte() routine (somewhere in IM V). It will
  557. tell you whether you are looking at the first byte of a 2-byte character,
  558. the 2nd byte of a two byte character or a single byte character. There should
  559. also be an example of using it in either IM V or VI.
  560.  
  561. >2. I am going to draw some text in a small box in my dialog. The box
  562. >is just a userItem in my DITL which I will do a FrameRect; it will be
  563. >wide enough for the longest possible string. What I am having a
  564. >problem with is how to actually draw the text. 
  565. >
  566.     What I usually do is to use _TextBox, which admittedly uses TextEdit
  567. to do the drawing, but since you are talking about a small amount of text
  568. it will work just fine.  That way TE gets to worry about all the issues and 
  569. you can get justifications (jeft/center/right) if you want.
  570.  
  571.  
  572. - -- 
  573. - -----------------------------------------------------------------------
  574. Leonard Rosenthol          Internet: leonardr@ccs.itd.umich.edu
  575. Director of Advanced Technology   AppleLink: MACgician
  576. Aladdin Systems, inc.          GEnie:     MACgician
  577.  
  578. +++++++++++++++++++++++++++
  579.  
  580. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  581. Organization: Kalamazoo College
  582. Date: Fri, 26 Jun 1992 14:51:39 GMT
  583.  
  584. leonardr@ccs.itd.umich.edu writes:
  585. >resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  586. >>
  587. >>I have a piece of code which I am hoping to make as
  588. >>"internationalizable" as possible.  ... but I have run into two problems
  589. >>concerning text in a Modal dialog box ...
  590. >>
  591. >>2. I am going to draw some text in a small box in my dialog. The box
  592. >>is just a userItem in my DITL which I will do a FrameRect; it will be
  593. >>wide enough for the longest possible string. What I am having a
  594. >>problem with is how to actually draw the text. 
  595. >>
  596. >    What I usually do is to use _TextBox, which admittedly uses TextEdit
  597. >to do the drawing, but since you are talking about a small amount of text
  598. >it will work just fine.  That way TE gets to worry about all the issues and 
  599. >you can get justifications (jeft/center/right) if you want.
  600.  
  601. You might want to check out NeoTextBox, Bryan Ressler's improvement on
  602. that trap.  I'm not that "up" on internationalization, but Bryan makes
  603. lots of references to the Script Manager in his code, so it must be
  604. good.  :-)
  605.  
  606. It's in the Winter 1992 develop (if you're in the Northern Hemisphere).
  607. - -- 
  608.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  609.  Never piss off a computer.
  610.  
  611. +++++++++++++++++++++++++++
  612.  
  613. From: leonardr@ccs.itd.umich.edu
  614. Organization: Campus Computing Sites, University of Michigan-Ann Arbor
  615. Date: Fri, 26 Jun 92 17:53:00 GMT
  616.  
  617. In article <1992Jun26.145139.22530@hobbes.kzoo.edu> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  618. >leonardr@ccs.itd.umich.edu writes:
  619. >>resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  620. >>>
  621. >>> [drawing international text in a box]
  622. >>>
  623. >>    What I usually do is to use _TextBox, which admittedly uses TextEdit
  624. >>to do the drawing, but since you are talking about a small amount of text
  625. >>it will work just fine.  That way TE gets to worry about all the issues and 
  626. >>you can get justifications (jeft/center/right) if you want.
  627. >
  628. >You might want to check out NeoTextBox, Bryan Ressler's improvement on
  629. >that trap.  I'm not that "up" on internationalization, but Bryan makes
  630. >lots of references to the Script Manager in his code, so it must be
  631. >good.  :-)
  632. >
  633.     If memory serves me correctly, the NeoTextBox stuff is NOT
  634. Script Manager compatible - though it is fast and does do full justification.
  635. I know someone who has done a bit of "internationalizatiion" to NTB, but it 
  636. still has a way to go.
  637.  
  638.  
  639. - -- 
  640. - -----------------------------------------------------------------------
  641. Leonard Rosenthol          Internet: leonardr@ccs.itd.umich.edu
  642. Director of Advanced Technology   AppleLink: MACgician
  643. Aladdin Systems, inc.          GEnie:     MACgician
  644.  
  645. +++++++++++++++++++++++++++
  646.  
  647. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  648. Organization: University of Illinois at Urbana
  649. Date: Sun, 28 Jun 1992 00:02:12 GMT
  650.  
  651. Thanks to Leonard, Jamie, and Dana for some answers and ideas.
  652.  
  653. 1. For the numbers, CharType seems to work fine, though I have not
  654. tested it on an interational machine yet. I think this will do it for
  655. me.
  656.  
  657. 2. As far as drawing text in my box goes: Though I used the TE
  658. routine TextBox elsewhere in my code (thanks for pointing that one
  659. out), it turns out that I need to do manipulation on the text in the
  660. original item I was asking about. So, I am checking GetSysJust() and
  661. doing some Char2Pixel's and drawing it by hand. The Script Manager
  662. routines are working out great!
  663.  
  664. pr
  665. - --
  666. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  667. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  668. System manager - Cognitive Science Group, Beckman Institute, UIUC
  669. Internet: resnick@cogsci.uiuc.edu
  670.  
  671. ---------------------------
  672.  
  673. From: csandy@cybaswan.UUCP (ap.parkman)
  674. Subject: Magazine Subs Info - Please help
  675. Date: 25 Jun 92 14:40:03 GMT
  676.  
  677. I am a programmer interested in obtaining some overseas
  678. subscriptions to U.S. Mac Magazines such as MacWorld/MacUser
  679. which impressed me on a recent visit as being:
  680.  
  681.      * Ahead of the U.K. versions in terms of News
  682.      * Bigger coverage then U.K. versions in terms of more
  683.        useful articles
  684.      * Useful for keeping an eye on U.S. Prices for comparison
  685.        with U.K. Pricing
  686.  
  687. To speed the process of obtaining such a subscription I would
  688. ideally like to FAX a subscription request payable against my
  689. MasterCard. I was wondering:
  690.  
  691.      - What other magazines do you suggest I consider?
  692.      - Could anyone be kind enough to send me the FAX
  693.        numbers of the relevant subscription departments
  694.        ( including MacWorld and MacUser )
  695.  
  696. You could e-mail me the responses if you prefer, although I
  697. suspect an airing of the matter could prove interesting to
  698. many readers of magazines who are unaware of the relative
  699. merits of alternatives. If there is a good response I'll
  700. summarise the opinions about each magazine.
  701.  
  702. Yours in hopeful anticipation.
  703.  
  704. Andy Parkman
  705.  
  706. Research Programmer,
  707. Dept. of Computer Science,
  708. Univ. Coll. of Swansea,
  709. Singleton Park,
  710. Swansea. SA2 8PP.
  711. U.K.
  712.  
  713. e-mail: csandy@uk.ac.swan.pyr
  714.  
  715. +++++++++++++++++++++++++++
  716.  
  717. From: buckeye@spf.trw.com (John Wallace)
  718. Organization: TRW Data Systems Center, Redondo Beach, CA
  719. Date: Fri, 26 Jun 92 22:18:51 GMT
  720.  
  721. In article <808@cybaswan.UUCP> csandy@cybaswan.UUCP (ap.parkman)
  722. writes:
  723. >I am a programmer interested in obtaining some overseas
  724. >subscriptions to U.S. Mac Magazines such as MacWorld/MacUser
  725. >which impressed me on a recent visit as being:
  726. >
  727. >     * Ahead of the U.K. versions in terms of News
  728. >     * Bigger coverage then U.K. versions in terms of more
  729. >       useful articles
  730. >     * Useful for keeping an eye on U.S. Prices for comparison
  731. >       with U.K. Pricing
  732. >
  733. >To speed the process of obtaining such a subscription I would
  734. >ideally like to FAX a subscription request payable against my
  735. >MasterCard. I was wondering:
  736. >
  737. >     - What other magazines do you suggest I consider?
  738. >     - Could anyone be kind enough to send me the FAX
  739. >       numbers of the relevant subscription departments
  740. >       ( including MacWorld and MacUser )
  741. >
  742. >Andy Parkman
  743. >e-mail: csandy@uk.ac.swan.pyr
  744.  
  745. It depends on what you want to read.  
  746.  
  747. For news, I would recommend MacWeek.  As a weekly magazine, its focus is 
  748. to deliver the latest news about major dealings in the Macintosh market.
  749. Its cost is $99 for US, $175 for Canada & Mexico, $300 for International.
  750. Write to: Customer Service Department, MacWEEK, c/o JCI, P.O. Box
  751. 1766, Riverton, N.J. 08077-7366
  752.  
  753. For programming, I would recommend MacTutor.  It contains neat
  754. articles that are of varying benefit depending on your programming
  755. level on the Mac.  (I don't have a copy handy for subscription info)
  756.  
  757. For reviews and buying information, there's MacWorld and MacUser.  As
  758. monthly publications, their emphasis is to evaluate products and make
  759. recommendations to end users.  (Again, sorry but I don't have a copy
  760. handy)
  761.  
  762. Cheers!
  763. John
  764.  
  765. +++++++++++++++++++++++++++
  766.  
  767. From: de19@umail.umd.edu (Dana S Emery)
  768. Date: 27 Jun 92 02:35:22 GMT
  769. Organization: Personal
  770.  
  771. In article <808@cybaswan.UUCP> csandy@cybaswan.UUCP (ap.parkman)
  772. writes:
  773. >I am a programmer interested in obtaining some overseas
  774. >subscriptions to U.S. Mac Magazines such as MacWorld/MacUser
  775.  
  776.  
  777. Mactutor died, but is now reborn (freindly buyout)
  778.  
  779. (310) 575-4343  
  780.  
  781. Xplain corp 
  782. po box 250025
  783. Los Angeles CA, USA 90025-250025
  784.  
  785. (in US) $40/55 yr (+ $72 source code disks). 
  786.  
  787. April-May 92 issue  is first under the new regime.
  788.  
  789. Dana S Emery. (de19@umail.umd.edu)
  790.  
  791. ---------------------------
  792.  
  793. From: cluther@morticia.cnns.unt.edu (Clay Luther)
  794. Subject: Converting a Unix Sockets-based program to MacTCP
  795. Organization: University of North Texas
  796. Date: Thu, 25 Jun 1992 22:59:45 GMT
  797.  
  798. Can anyone offer advice on taking a simple unix sockets-based program, and
  799. porting to MacTCP?
  800.  
  801. For instance, we have need to use ping.  We'd like to take the ping source and
  802. make it a mpw tool.
  803.  
  804. Just looking for pointers and advice.
  805.  
  806. Thanks!
  807.  
  808. - -- 
  809. Clay W. Luther                  cluther@morticia.cnns.unt.edu
  810. Macintosh/Unix Programmer for Vortech Data, Inc.
  811. Virtual System Consultant for the UNT Center for Network Neuroscience
  812. (214) 994-1377
  813.  
  814. +++++++++++++++++++++++++++
  815.  
  816. From: veizades@apple.com (John Veizades)
  817. Date: Fri, 26 Jun 1992 17:15:07 GMT
  818. Organization: Apple Computer, Inc
  819.  
  820. In article <cluther.709513185@morticia>, cluther@morticia.cnns.unt.edu (Clay
  821. Luther) writes:
  822. > Can anyone offer advice on taking a simple unix sockets-based program, and
  823. > porting to MacTCP?
  824. > For instance, we have need to use ping.  We'd like to take the ping source and
  825. > make it a mpw tool.
  826. > Just looking for pointers and advice.
  827. On the developer CD starting at number X there are sources and objects to a ping
  828. tool.  The tool is called MPing and it trys to emulate as much of the UNIX ping
  829. functionality as is possible with the current release of MacTCP.
  830.  
  831. John Veizades...
  832. Apple Computer, Inc.
  833.  
  834. +++++++++++++++++++++++++++
  835.  
  836. From: jbrowne@void.ncsa.uiuc.edu (Jim Browne)
  837. Organization: University of Illinois at Urbana
  838. Date: Sat, 27 Jun 1992 00:59:39 GMT
  839.  
  840. cluther@morticia.cnns.unt.edu (Clay Luther) writes:
  841.  
  842. >Can anyone offer advice on taking a simple unix sockets-based program, and
  843. >porting to MacTCP?
  844.  
  845. >-- 
  846. >Clay W. Luther                  cluther@morticia.cnns.unt.edu
  847. >Macintosh/Unix Programmer for Vortech Data, Inc.
  848. >Virtual System Consultant for the UNT Center for Network Neuroscience
  849. >(214) 994-1377
  850.  
  851. You can use the socket library in misc/unsupported on ftp.ncsa.uiuc.edu
  852.  
  853.  
  854. - -- 
  855. Jim Browne                                          | jbrowne@ncsa.uiuc.edu  |
  856. NCSA/STG System Administrator                       | stgadmin@ncsa.uiuc.edu |
  857. System Administration: Where the fun never ends...  | (217) 244-7798         |
  858. "I was ionized... but now I'm better." - Bukaroo Banzai
  859.  
  860. ---------------------------
  861.  
  862. From: davidp@calvin.usc.edu (David Peterson)
  863. Subject: How do I dequeue MacTCP calls?
  864. Date: 25 Jun 1992 17:17:27 -0700
  865. Organization: University of Southern California, Los Angeles, CA
  866.  
  867.  
  868.  
  869. Subject about sums it up...
  870.  
  871. How do I get rid of async MacTCP calls that haven't completed yet?
  872.  
  873. I can walk through my parameter blocks and find the ones that are inProgress,
  874. but calling Dequeue() on them tells me they aren't in the queue (or bombs).
  875. Sure enough, find the driver in Macsbug, and all the fields of dCtlQHdr are
  876. nil.
  877.  
  878. So where are they queued, and how do I get rid of them?
  879.  
  880. Thanks,
  881. - -dave.
  882.  
  883. +++++++++++++++++++++++++++
  884.  
  885. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  886. Organization: University of Illinois at Urbana
  887. Date: Fri, 26 Jun 1992 03:38:16 GMT
  888.  
  889. davidp@calvin.usc.edu (David Peterson) writes:
  890.  
  891. >How do I get rid of async MacTCP calls that haven't completed yet?
  892.  
  893. If they are outstanding TCP calls, you can simply use *another*
  894. parameter block, copy the tcpStream from the PB you want to canel into
  895. the new PB, set the csCode to TCPAbort or TCPRelease (depending on
  896. which you really want to do) and call PBControl (usually
  897. synchronously, but you can do it asynchronously) on the new PB. The
  898. inProgress PB will complete with connectionTerminated and you will get
  899. a TCPNotify call with TCPTerminate and the terminReason set to
  900. TCPULPAbort.
  901.  
  902. If they are outstanding UDP calls, you can also use another PB, copy
  903. the udpStream from the PB you want to cancel to the new PB, set the
  904. csCode to UDPRelease and call PBControl on the new PB. The inProgress
  905. PB will complete with connectionTerminated as above. ***NOTE*** You
  906. CAN'T do this if there is an outstanding UDPWrite, only on an
  907. outstanding UDPRead!! There is no way to cancel an outstanding
  908. UDPWrite.
  909.  
  910. >I can walk through my parameter blocks and find the ones that are inProgress,
  911. >but calling Dequeue() on them tells me they aren't in the queue (or bombs).
  912. >Sure enough, find the driver in Macsbug, and all the fields of dCtlQHdr are
  913. >nil.
  914.  
  915. >So where are they queued, and how do I get rid of them?
  916.  
  917. Yeah, calling Dequeue would be a really bad idea. The Device Manager
  918. only allows you to be working on one PB at a time, so MacTCP decided
  919. to pull the PB's out of the queue and store them internally so that it
  920. could work on more than one request at a time. That is why you
  921. actually have to make another PBControl call to get things cancelled.
  922.  
  923. pr
  924. - --
  925. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  926. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  927. System manager - Cognitive Science Group, Beckman Institute, UIUC
  928. Internet: resnick@cogsci.uiuc.edu
  929.  
  930. +++++++++++++++++++++++++++
  931.  
  932. From: jstevens@crick.ssctr.bcm.tmc.edu (Jason Philip Stevens)
  933. Date: 26 Jun 1992 15:56:46 GMT
  934. Organization: Baylor College of Medicine, Houston, Tx
  935.  
  936.  
  937. In article <l4kognINN4u6@calvin.usc.edu>, davidp@calvin.usc.edu (David Peterson) writes:
  938. |> 
  939. |> 
  940. |> Subject about sums it up...
  941. |> 
  942. |> How do I get rid of async MacTCP calls that haven't completed yet?
  943. |> 
  944. |> I can walk through my parameter blocks and find the ones that are inProgress,
  945. |> but calling Dequeue() on them tells me they aren't in the queue (or bombs).
  946. |> Sure enough, find the driver in Macsbug, and all the fields of dCtlQHdr are
  947. |> nil.
  948.  
  949. A queued MacTCP call can be dequeued by calling TCPAbort (MacTCP Developer's
  950. guide, p.54).  This does have unfortunate side effects, however:  your connection
  951. is closed and all outstanding data is lost.
  952.  
  953. - -jps
  954.  
  955. - -- 
  956. Jason Stevens            Internet:  jstevens@bcm.tmc.edu
  957. Network User Services        Voice:  (713) 798-7370
  958. Baylor College of Medicine    Opinions expressed are mine alone.
  959.  
  960.  
  961. +++++++++++++++++++++++++++
  962.  
  963. From: davidp@calvin.usc.edu (David Peterson)
  964. Date: 26 Jun 1992 11:10:52 -0700
  965. Organization: University of Southern California, Los Angeles, CA
  966.  
  967.  
  968.  
  969. Guess I didn't make myself clear enough the first time...
  970.  
  971. I need to dequeue calls without killing the current connection.
  972.  
  973. What I'm trying to do is hand the StreamPtr off to another program,
  974. but I have to kill all pending IO in the current program first.
  975.  
  976. ---------------------------
  977.  
  978. From: bowman@reed.edu (Eric Bowman)
  979. Subject: Does the PolySmooth PicComment work?
  980. Date: 25 Jun 92 23:56:33 GMT
  981. Organization: Reed College, Portland, OR
  982.  
  983. I've attempted make it work, but it appears to have no effect; furthermore,
  984. it doesn't appear to make any changes to the postscript output.  Has any-
  985. one out there gotten it to work with a LaserWriter?
  986.  
  987. Thanks,
  988. bobo
  989. bowman@reed.edu
  990.  
  991. +++++++++++++++++++++++++++
  992.  
  993. From: oster@well.sf.ca.us (David Phillip Oster)
  994. Organization: Whole Earth 'Lectronic Link
  995. Date: Fri, 26 Jun 1992 05:45:31 GMT
  996.  
  997. Develop Magazine in issue 9 or 110 ran an article on extracting the outlines
  998. from true type fonts. In that article was code for producing a PICT that
  999. used a quickdraw polygon simulation of a bezier curve when drawn on the
  1000. screen, but when drawn to a postscript printer, it used polysmooth to
  1001. draw the actual bezier curve.  It works.
  1002.  
  1003. ---------------------------
  1004.  
  1005. From: ejohnson@sparc3.cs.uiuc.edu (Eric E Johnson)
  1006. Subject: Why is gray drawing slower than color?
  1007. Organization: University of Illinois at Urbana-Champaign
  1008. Date: Fri, 26 Jun 1992 06:34:15 GMT
  1009.  
  1010. Well, after a lot of work, I have some code that will draw color icons
  1011. on the screen at a very rapid rate.  But, when I change the settings on
  1012. the screen from color to grays, the rate at which drawing takes place
  1013. drops considerably.  I even created icons using a gray palatte, which
  1014. helped a little bit, but the speed it still *very* slow.
  1015.  
  1016. Has anyone else had this experience?  Does anyone know why this might
  1017. happen?
  1018.  
  1019. Eric
  1020. - -- 
  1021. Eric Johnson               | "The American Republic will endure until the day
  1022. ejohnson@suna0.cs.uiuc.edu |  Congress discovers that it can bribe the public
  1023. eej37047@uxa.cso.uiuc.edu  |  with the public's money" - Alexis de Toucqueville
  1024.  
  1025. +++++++++++++++++++++++++++
  1026.  
  1027. From: buckeye@spf.trw.com (John Wallace)
  1028. Organization: TRW Data Systems Center, Redondo Beach, CA
  1029. Date: Fri, 26 Jun 92 22:39:46 GMT
  1030.  
  1031. In article <1992Jun26.063415.19794@sunb10.cs.uiuc.edu> ejohnson@sparc3.cs.uiuc.edu (Eric E Johnson) writes:
  1032. >Well, after a lot of work, I have some code that will draw color icons
  1033. >on the screen at a very rapid rate.  But, when I change the settings on
  1034. >the screen from color to grays, the rate at which drawing takes place
  1035. >drops considerably.  I even created icons using a gray palatte, which
  1036. >helped a little bit, but the speed it still *very* slow.
  1037. >
  1038. >Has anyone else had this experience?  Does anyone know why this might
  1039. >happen?
  1040. >
  1041. >Eric
  1042. >--
  1043. >Eric Johnson               | "The American Republic will endure until the day
  1044. >ejohnson@suna0.cs.uiuc.edu |  Congress discovers that it can bribe the public
  1045. >eej37047@uxa.cso.uiuc.edu  |  with the public's money" - Alexis de Toucqueville
  1046.  
  1047. It may have to do with pixel depth.  For example, drawing it in 256
  1048. colors/grays is faster than drawing in 16 colors/grays.  The reason
  1049. being that in 256 colors/grays a pixel takes up 1 byte, but in 16
  1050. colors/grays a pixel takes up 1/2 byte which must be masked in to the
  1051. surrounding data.
  1052.  
  1053. As far as I know, there should be no difference in drawing speed 
  1054. between colors and grays at the same pixel depth (for the same graphics 
  1055. card on the same Macintosh).
  1056.  
  1057. Cheers!
  1058. John
  1059. - --------
  1060. John Wallace
  1061.  
  1062. +++++++++++++++++++++++++++
  1063.  
  1064. From: c9107786@frey.newcastle.edu.au (Dave Leonard)
  1065. Organization: Department of Mathematics, Uni of Newcastle, Oz.
  1066. Date: Sat, 27 Jun 1992 11:58:45 GMT
  1067.  
  1068. buckeye@spf.trw.com (John Wallace) writes:
  1069.  
  1070. >In article <1992Jun26.063415.19794@sunb10.cs.uiuc.edu> ejohnson@sparc3.cs.uiuc.edu (Eric E Johnson) writes:
  1071. >>Well, after a lot of work, I have some code that will draw color icons
  1072. >>on the screen at a very rapid rate.  But, when I change the settings on
  1073. >>the screen from color to grays, the rate at which drawing takes place
  1074. >>drops considerably.  I even created icons using a gray palatte, which
  1075. >>helped a little bit, but the speed it still *very* slow.
  1076. >>
  1077. >>Has anyone else had this experience?  Does anyone know why this might
  1078. >>happen?
  1079.  
  1080. >It may have to do with pixel depth.  For example, drawing it in 256
  1081. >colors/grays is faster than drawing in 16 colors/grays.  The reason
  1082. >being that in 256 colors/grays a pixel takes up 1 byte, but in 16
  1083. >colors/grays a pixel takes up 1/2 byte which must be masked in to the
  1084. >surrounding data.
  1085.  
  1086. >As far as I know, there should be no difference in drawing speed 
  1087. >between colors and grays at the same pixel depth (for the same graphics 
  1088. >card on the same Macintosh).
  1089.  
  1090. It may also be that quickdraw or some pallete managing code is thinking
  1091. about going from a (colourful) grey to a (grey) grey. remember how when
  1092. viewing gifs and you background the viewer, the pallete manager tries to do
  1093. its best to make the gif look okay and not a psycadelic explosion of
  1094. colour? well the same thing might be happening here. Your grey-looking
  1095. icons which are described using RGB are being translated somewhere to come
  1096. up as 8-bit grayscale images. 
  1097.  
  1098. Just how slow is it? (More than 2 and i'd be surprised)
  1099.  
  1100. dave
  1101. - -- 
  1102.  Dave Leonard, Uni of Newcastle           c9107786@frey.newcastle.edu.au
  1103.     "and you get a linear line" - M. Fu
  1104.  
  1105. +++++++++++++++++++++++++++
  1106.  
  1107. From: ejohnson@sparc3.cs.uiuc.edu (Eric E Johnson)
  1108. Organization: University of Illinois at Urbana-Champaign
  1109. Date: Sat, 27 Jun 1992 21:18:38 GMT
  1110.  
  1111. >>It may have to do with pixel depth.  For example, drawing it in 256
  1112. >>colors/grays is faster than drawing in 16 colors/grays.  The reason
  1113. >>being that in 256 colors/grays a pixel takes up 1 byte, but in 16
  1114. >>colors/grays a pixel takes up 1/2 byte which must be masked in to the
  1115. >>surrounding data.
  1116.  
  1117. My icons are 24x24, which means the 1/2 byte issue won't be a problem.
  1118. And, I'm making sure that the coordinates that I draw to are always byte
  1119. aligned, so that no bit shifting is necessary.
  1120.  
  1121. In <1992Jun27.115845.23416@frey.newcastle.edu.au>
  1122. c9107786@frey.newcastle.edu.au (Dave Leonard) writes: 
  1123.  
  1124. >It may also be that quickdraw or some pallete managing code is thinking
  1125. >about going from a (colourful) grey to a (grey) grey. remember how when
  1126. >viewing gifs and you background the viewer, the pallete manager tries to do
  1127. >its best to make the gif look okay and not a psycadelic explosion of
  1128. >colour? well the same thing might be happening here. Your grey-looking
  1129. >icons which are described using RGB are being translated somewhere to come
  1130. >up as 8-bit grayscale images. 
  1131.  
  1132. >Just how slow is it? (More than 2 and i'd be surprised)
  1133.  
  1134. Its about twice as slow.  That's the weird part.  Let me give some more
  1135. details on what I'm doing.
  1136.  
  1137. I have an offscreen gWorld in which I plot a single color icon (cicn)
  1138. into the gWorld.  Then, using some 68000 code, I mass produce it very
  1139. quickly.  Then, I use copybits to put it on the screen.  Everything
  1140. works perfectly fine under color and its lightning fast, but under gray
  1141. mode, its really slow.
  1142.  
  1143. When I create my gWorld, I make sure to use the current color palette of
  1144. the current screen, so copying between the gWorld and the screen would
  1145. still be fast.  I also use PlotCIcon to put the color icon into my
  1146. gWorld so PlotCIcon should fix the colors.  Keep in mind that I only use
  1147. PlotCIcon once to plot to the offscreen gWorld.  I have my own code that
  1148. takes this initial plot and mass produce it.  This works fine under
  1149. color, but under grays, the speed goes to hell.
  1150.  
  1151. What palette should I use when creating the icons in ResEdit?
  1152.  
  1153. - -- 
  1154. Eric Johnson               | "The American Republic will endure until the day
  1155. ejohnson@suna0.cs.uiuc.edu |  Congress discovers that it can bribe the public
  1156. eej37047@uxa.cso.uiuc.edu  |  with the public's money" - Alexis de Toucqueville
  1157.  
  1158. +++++++++++++++++++++++++++
  1159.  
  1160. From: ejohnson@sparc3.cs.uiuc.edu (Eric E Johnson)
  1161. Organization: University of Illinois at Urbana-Champaign
  1162. Date: Sun, 28 Jun 1992 00:43:55 GMT
  1163.  
  1164. I discovered why my grey scale drawings were going so slow.  When I
  1165. created my offscreen gWorld, the code that I relied on assumed that the
  1166. default color table was going to be color.  So, it was grabbing a
  1167. default color table for color mode.  I changed it to check for either
  1168. gray scale or color mode, and then grab the appropriate system colot
  1169. table for the offscreen gWorld.
  1170.  
  1171. - -- 
  1172. Eric Johnson               | "The American Republic will endure until the day
  1173. ejohnson@suna0.cs.uiuc.edu |  Congress discovers that it can bribe the public
  1174. eej37047@uxa.cso.uiuc.edu  |  with the public's money" - Alexis de Toucqueville
  1175.  
  1176. ---------------------------
  1177.  
  1178. End of C.S.M.P. Digest
  1179. **********************
  1180.